package callnumber.gtdev5.com.photoVault.widget;

import android.animation.AnimatorSet;
import android.content.Context;
import android.support.annotation.NonNull;
import android.widget.Button;
import android.widget.TextView;

import callnumber.gtdev5.com.photoVault.R;


/**
 * Created by cheng
 * PackageName WX_AppLock
 * 2018/3/27 15:31
 */

public class WhiteDialogBoot extends BaseDialog {

    private Button cancle;
    private Button setting;

    private onClickListener onClickListener;

    public WhiteDialogBoot(@NonNull Context context) {
        super(context);
    }

    @Override
    protected float setWidthScale() {
        return 0.9f;
    }

    @Override
    protected AnimatorSet setEnterAnim() {
        return null;
    }

    @Override
    protected AnimatorSet setExitAnim() {
        return null;
    }

    @Override
    protected void init() {
        cancle = findViewById( R.id.dialog_cancle);
        setting = findViewById(R.id.dialog_setting);
        cancle.setOnClickListener(v -> {
            if (onClickListener != null){
                dismiss();
                onClickListener.onClick(0);
            }
        });
        setting.setOnClickListener(v -> {
            if (onClickListener != null){
                dismiss();
                onClickListener.onClick(1);
            }
        });

    }

    public void setTextTip(String textTip){
        ((TextView)findViewById(R.id.tv_bootdialog_tip)).setText(textTip);
    }

    @Override
    protected int getContentViewId() {
        return R.layout.dialog_whiteboot;
    }

    public void setOnClickListener(onClickListener listener){
        this.onClickListener = listener;
    }

    public interface onClickListener{
        void onClick(int num);
    }
}
